install.packages("FinancialInstrument", repos="http://R-Forge.R-project.org")
install.packages("blotter", repos="http://R-Forge.R-project.org")
install.packages("quantstrat", repos="http://R-Forge.R-project.org")

source("http://www.rmetrics.org/Rmetrics.R")
install.Rmetrics()

require(FinancialInstrument)
require(blotter) 
Data <- data.frame(primary_id="CL", month_cycle="F,G,H,J,K,M,N,Q,U,V,X,Z")
Data <- rbind(Data, data.frame(primary_id="STXE", month_cycle="H,M,U,Z"))
build_series_symbols(Data, yearlist=c(0,1,2))

# read in data that would be suitable for load.instruments on root contracts
Data <- read.csv("series_data.csv", stringsAsFactors=FALSE)
# set the type to guaranteed_spread
Data$type <- "guaranteed_spread"
# call build_spread_symbols
output <- build_spread_symbols(Data[6:7,], start_date="2010-01-01")

#returns the future
v1 <- getInstrument('VX') 
